Skip to content

fix(tiles): sign a checkpoint only over a tree extending the published one - #3

Merged
HaoZeke merged 2 commits into
mainfrom
fix/checkpoint-consistency
Nov 16, 2026
Merged

HaoZeke merged 2 commits into
mainfrom
fix/checkpoint-consistency

Conversation

@HaoZeke

@HaoZeke HaoZeke commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Writer::checkpoint now signs only a tree that extends the checkpoint already published under its origin.

  • publish refused only when the published checkpoint under the origin was for a larger size. A store whose entries were replaced got a second checkpoint at the published size with another root, or a larger one that does not extend it.
  • publish now checks the tree against the checkpoint published under the same origin before signing: the empty tree's root at size 0, the log's own root at the log's size, and otherwise a consistency proof read from the tiles and checked with rfc9162::verify_consistency. A tree that is not an extension is Error::Corrupt naming both heads, and the published checkpoint stays.
  • The test publishes at 300 entries, puts that checkpoint beside other entries and expects both signatures refused with the checkpoint left alone, while the log grown from the published tree is signed.

The branch has a towncrier fragment.

…hed one

Writer::checkpoint promises never to sign a checkpoint inconsistent with
one it signed, but publish refuses only when the published checkpoint
under the origin is for a larger size. A store whose entries were
replaced gets a second checkpoint at the published size with another
root, or a larger one that does not extend it. The test publishes at 300
entries, puts that checkpoint beside other entries and expects both
signatures refused with the checkpoint left alone, while the log grown
from the published tree is signed.
…d one

publish now checks the tree against the checkpoint published under the
same origin before signing: the empty tree's root at size 0, the log's
own root at the log's size, and otherwise a consistency proof read from
the tiles through TileHashReader and checked with
rfc9162::verify_consistency. A tree that is not an extension is
Error::Corrupt naming both heads, and the published checkpoint stays. A
larger published size is still OutOfRange. The doc says which trees
replace a published checkpoint.
@HaoZeke
HaoZeke merged commit 4f6cf02 into main Nov 16, 2026
6 checks passed
@HaoZeke
HaoZeke deleted the fix/checkpoint-consistency branch November 16, 2026 05:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant